package com.wtb.javatool.service;

import com.wtb.javatool.common.PageBean;
import com.wtb.javatool.dto.AssignmentDto;
import com.wtb.javatool.dto.StudentGradeDto;
import com.wtb.javatool.entity.Assignment;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface AssignmentService {
    void addAssignmentAndUndertaker(Assignment assignment, List<Long> userIdList);

    List<AssignmentDto> findAssignmentsByTaskId(Long taskId,Integer projectType);

    void deleteAssignmentByAssignmentId(List<Long> assignmentId);
    void updateAssignmentStatusByAssignmentId(List<Long>assignmentIds,Integer assignmentStatus);
    void updateAssignmentEndTimeAndTeamByAssignmentId(Assignment assignment);

    void updateAssignmentsEndTimeByAssignmentIds(List<Long> assignmentIdList, Date endTime);

    void upsertDeleteAssignmentUndertakers(Long Assignment, List<Long> userList);

    List<AssignmentDto> findTasksAssignments(Long projectId,Integer assignmentStatus,Integer taskType,Long courseId,Integer projectType);

    AssignmentDto findTaskAssignmentNumberByCourseId(Long courseId,Integer evaluationType);

    /**
     * 获取课程成绩数据
     *
     * @param courseId 课程ID
     * @param classId 班级ID（可选）
     * @param teamId 小组ID（可选）
     * @param studentName 学生姓名或学号（可选）
     * @param studentMajor 学生专业（可选）
     * @param currentPage 当前页数
     * @param pageSize 每页条数
     * @return 分页后的学生成绩数据
     */
    PageBean<StudentGradeDto> findCourseGrades(Long courseId, Long classId, Long teamId, 
                                            String studentName, String studentMajor, 
                                            Integer currentPage, Integer pageSize);

    /**
     * 导出课程成绩数据
     *
     * @param courseId 课程ID
     * @return 导出文件的URL
     */
    String exportCourseGrades(Long courseId);
}
